var editor;
$(function(){
    editor = UE.getEditor('coursecontent',{
        readonly: true
    });

//    setTimeout(() => {
//        editor.disable();
//    }, 3000);

});

//编辑
function item_edit(){
    $('#edit').attr("style","display:none;");
    $("#save").attr("style","display:block;");
    editor.enable();
}

//保存
function item_save(){
    $.ajax({
        url: basePath + "/company/company_save",
        data:{
            words: encodeURI(encodeURI(editor.getContent()))
        },
        type: 'post',
        dataType: 'json',
        success(result){
            if(result.code == '1') {
                dialogMsg('保存成功！', 0);
                $('#edit').attr("style","display:block;");
                $("#save").attr("style","display:none;");
                editor.disable();
            }else{
                dialogMsg('保存失败！', 0);
            }
        }
    });


}